﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace DRSLF_robot_
{
    public class Sensor
    {
        public Point Position;
        public Size Size;
        public Sensor(Point position, Size size)
        {
            Size = size;
            Position = position;
        }

        public Bitmap returnSensorHighLight()
        {
            Bitmap bmiSen = new Bitmap(250, 250);
            Graphics g = Graphics.FromImage(bmiSen);
            g.DrawRectangle(new Pen(Color.Red,2), Position.X - Size.Width / 2, Position.Y - Size.Height / 2, Size.Width, Size.Height);
            bmiSen.SetPixel(Position.X, Position.Y, Color.Red);
            return bmiSen;
        }

        public Bitmap returnSensorImage()
        {
            Bitmap bmiSen = new Bitmap(250, 250);
            Graphics g = Graphics.FromImage(bmiSen);
            g.DrawRectangle(new Pen(Color.Purple), Position.X - Size.Width / 2, Position.Y - Size.Height / 2, Size.Width, Size.Height);
            bmiSen.SetPixel(Position.X, Position.Y, Color.Red);
            return bmiSen;
        }

        public String ToString()
        {
            return Position.ToString();
        }

        public String ToPython(int index)
        {
            return index.ToString() + "/" + Position.X.ToString() + "/" + Position.Y.ToString() ;
        }
    }
}
